﻿@model IEnumerable<TCC.CMFlow.Models.WorkflowDado>

@foreach (var item in Model.OrderBy(o => !o.Ordem.HasValue ? 1 : 0).ThenBy(o => o.Ordem))
{
    if(item.Childrens != null && item.Childrens.Any())
    {
        <div class="panel @(item.Parent == null ? "panel-primary" : "panel-default")" style="margin-top: 15px">
            <div class="panel-heading clearfix">

                <h3 class="panel-title pull-left"><strong>@item.NomeAtributo</strong></h3>

            </div>

            <div class="panel-body">
                @Html.Partial("_WorkflowDados", item.Childrens)
            </div>
        </div>
    }
    else
    {
        <div class="row">
            <div class="col-md-3"><strong>@item.NomeAtributo</strong></div>
            <div class="col-md-9">@item.ValorAtributo</div>
        </div>
    }
}
